import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

class SettingProvider extends ChangeNotifier {
  bool showTag = false;

  SettingProvider() {
    loadSettings();
  }

  set setShowTag(bool value) {
    showTag = value;
    notifyListeners();
  }


  void toggleTag() async {
    showTag = !showTag;
    final prefs = await SharedPreferences.getInstance();
    await prefs.setBool('showTag', showTag);
    notifyListeners();
  }



  Future<void> loadSettings() async {
    final prefs = await SharedPreferences.getInstance();
    showTag = prefs.getBool('showTag') ?? true;
    notifyListeners();
  }
}
